<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>编辑机构</title>
    <%@ include file="../../common/meta.jsp" %>
    <%@ include file="../../common/common-body.jsp" %>
    <link href="${ctx}/css/page/common-win.css?t=${now}" rel="stylesheet">
    <script src="${ctx}/js/ueditor/ueditor.config.js?t=${now}"></script>
    <script src="${ctx}/js/ueditor/ueditor.all.js?t=20181010"></script>
    <script src="${ctx}/js/plugins/validate/jquery.validate.custom.js?t=20181024"></script>
    <style>
        #_btnDiv{
            height: 34px;
            margin-bottom: 0px;
        }
        .right-btn{
            float: right;
            margin-right: 5px;
            height: 25px;
            padding-top: 2px!important;
            margin-top: -7px;
        }
        .div-style{
            border: 1px solid #dddddd;
            height: 500px;
            padding: 10px;
        }
        ._packageDiv{
            height: 500px;
            overflow-y: scroll;
            overflow-x: hidden;
        }
    </style>
    <script>
        var editType = '${editType}';
        var searchInfo = ${searchInfo};
        var oneBizAppInfo = ${oneBizAppInfo};
        var packageMap = ${packageMap};
        var packageList = ${packageList};
        var searchStr = '${searchStr}';
        var hasPackage = '${hasPackage}';
    </script>
</head>
<body class="gray-bg">
<div id="vue">
    <div class="myContent">
        <div class="tabs-container">
            <div class="tab-content">
                <%--项目简介--%>
                <div id="tab-1" class="tab-pane active">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="ibox float-e-margins myIbox">
                                <div class="ibox-title">
                                    <h5>
                                        <c:if test="${editType == 'edit'}">
                                            编辑服务项
                                        </c:if>
                                        <c:if test="${editType == 'info'}">
                                            服务项详情
                                        </c:if>
                                    </h5>
                                </div>
                                <div class="ibox-content">
                                    <h5 class="page-header page-header-new"><i class="fa fa-file-text"></i>&nbsp;&nbsp;基本信息</h5>
                                    <form class="form-horizontal m-t" id="_orgBizAppDataForm">
                                        <c:choose>
                                            <c:when test="${editType=='info'}">
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">状态：</label>
                                                    <label class="col-sm-8 control-label control-label-content">
                                                        <c:forEach items="${statusMap}" var="item">
                                                            <c:if test="${not empty oneBizAppInfo && oneBizAppInfo.status == item.key}">
                                                                ${item.value}
                                                            </c:if>
                                                        </c:forEach>
                                                    </label>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">服务项名称：</label>
                                                    <label class="col-sm-3 control-label control-label-content">${not empty oneBizAppInfo ? oneBizAppInfo.appName : ''}</label>
                                                    <label class="col-sm-2 control-label">业务类型：</label>
                                                    <label class="col-sm-3 control-label control-label-content">${not empty oneBizAppInfo ? oneBizAppInfo.bizName : ''}</label>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">机构名称：</label>
                                                    <label class="col-sm-3 control-label control-label-content">${not empty oneBizAppInfo ? oneBizAppInfo.orgName : ''}</label>
                                                    <label class="col-sm-2 control-label">服务商：</label>
                                                    <label class="col-sm-3 control-label control-label-content">${not empty oneBizAppInfo ? oneBizAppInfo.isvName : ''}</label>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">服务有效期：</label>
                                                    <label class="col-sm-3 control-label control-label-content">${not empty oneBizAppInfo ? oneBizAppInfo.validDay + '天' : ''}</label>
                                                    <label class="col-sm-2 control-label">排序：</label>
                                                    <label class="col-sm-3 control-label control-label-content">${not empty oneBizAppInfo ? oneBizAppInfo.sortNum : ''}</label>
                                                </div>
                                                <c:if test="${not empty oneBizAppInfo && oneBizAppInfo.otherServiceType == 'html'}">
                                                    <h5 class="page-header page-header-new"><i class="fa fa-file-text"></i>&nbsp;&nbsp;扩展信息</h5>
                                                    <div class="form-group">
                                                        <label class="col-sm-2 control-label">服务提供方式：</label>
                                                        <label class="col-sm-8 control-label control-label-content">
                                                            <c:forEach items="${statusMap}" var="item">
                                                                <c:if test="${not empty oneBizAppInfo && oneBizAppInfo.appType == item.key}">
                                                                    ${item.value}
                                                                </c:if>
                                                            </c:forEach>
                                                        </label>
                                                    </div>
                                                    <div class="form-group">
                                                        <label class="col-sm-2 control-label">h5地址：</label>
                                                        <label class="col-sm-8 control-label control-label-content">${not empty oneBizAppInfo ? oneBizAppInfo.appLinkUrl : ''}</label>
                                                    </div>
                                                </c:if>
                                                <c:if test="${hasPackage == 1}">
                                                    <h5 class="page-header page-header-new"><i class="fa fa-file-text"></i>&nbsp;&nbsp;服务包</h5>
                                                    <c:if test="${not empty packageList}">
                                                        <c:forEach items="${packageList}" var="item">
                                                            <div class="form-group">
                                                                <label class="col-sm-2 control-label">服务包名称：</label>
                                                                <label class="col-sm-3 control-label control-label-content">${not empty item ? item.packageName : ''}</label>
                                                                <label class="col-sm-2 control-label">排序：</label>
                                                                <label class="col-sm-3 control-label control-label-content">${not empty item ? item.sortNum : ''}</label>
                                                            </div>
                                                            <div class="form-group">
                                                                <label class="col-sm-2 control-label">简介：</label>
                                                                <label class="col-sm-8 control-label control-label-content">${not empty item ? item.summary : ''}</label>
                                                            </div>
                                                            <div class="form-group">
                                                                <label class="col-sm-2 control-label">服务说明：</label>
                                                                <label class="col-sm-8 control-label control-label-content">${not empty item ? item.packageContent : ''}</label>
                                                            </div>
                                                            <div class="form-group">
                                                                <label class="col-sm-2 control-label">是否必备：</label>
                                                                <label class="col-sm-8 control-label control-label-content">${not empty item && item.require == 'Y' ? '是' : '否'}</label>
                                                            </div>
                                                        </c:forEach>
                                                    </c:if>
                                                </c:if>
                                            </c:when>
                                            <c:otherwise>
                                                <div class="form-group form-group-new">
                                                    <label class="col-sm-2 control-label"><span style="color: red">*</span>状态：</label>
                                                    <div class="col-sm-3">
                                                        <select class="form-control" name="status" id="status" required>
                                                            <option value="">--请选择--</option>
                                                            <c:forEach items="${statusMap}" var="item">
                                                                <option value="${item.key}" ${not empty oneBizAppInfo && oneBizAppInfo.status == item.key? 'selected' : '' }>${item.value}</option>
                                                            </c:forEach>
                                                        </select>
                                                        <span class="help-block m-b-none tip"></span>
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">服务项名称：</label>
                                                    <label class="col-sm-3 control-label control-label-content">${not empty oneBizAppInfo ? oneBizAppInfo.appName : ''}</label>
                                                    <label class="col-sm-2 control-label">业务类型：</label>
                                                    <label class="col-sm-3 control-label control-label-content">${not empty oneBizAppInfo ? oneBizAppInfo.bizName : ''}</label>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">机构名称：</label>
                                                    <label class="col-sm-3 control-label control-label-content">${not empty oneBizAppInfo ? oneBizAppInfo.orgName : ''}</label>
                                                    <label class="col-sm-2 control-label">服务商：</label>
                                                    <label class="col-sm-3 control-label control-label-content">${not empty oneBizAppInfo ? oneBizAppInfo.isvName : ''}</label>
                                                </div>
                                                <div class="form-group form-group-new">
                                                    <label class="col-sm-2 control-label"><span style="color: red">*</span>服务有效期：</label>
                                                    <div class="col-sm-3">
                                                        <input type="text" id="validDay" name="validDay" class="form-control" maxlength="6" isPInteger="true" required value="${not empty oneBizAppInfo ? oneBizAppInfo.validDay : ''}" placeholder="签约或购买后提供服务有效期">
                                                        <span class="help-block m-b-none tip"></span>
                                                    </div>
                                                    <label class="col-sm-1" style="text-align: left; padding-top: 7px; padding-left: 0px;">天</label>
                                                    <label class="col-sm-1 control-label">排序：</label>
                                                    <div class="col-sm-3">
                                                        <input type="text" id="sortNum" name="sortNum" class="form-control" maxlength="9" isPInteger="true" value="${not empty oneBizAppInfo ? oneBizAppInfo.sortNum : ''}">
                                                        <span class="help-block m-b-none tip"></span>
                                                    </div>
                                                </div>
                                                <c:if test="${not empty oneBizAppInfo && oneBizAppInfo.appType == 'html'}">
                                                    <h5 class="page-header page-header-new"><i class="fa fa-file-text"></i>&nbsp;&nbsp;扩展信息</h5>
                                                    <div class="form-group">
                                                        <label class="col-sm-2 control-label">服务提供方式：</label>
                                                        <div class="col-sm-3">
                                                            <label class="col-sm-3 control-label control-label-content">H5</label>
                                                        </div>
                                                        <label class="col-sm-2 control-label">是否有平台中间页：</label>
                                                        <div class="col-sm-3">
                                                            <label class="col-sm-3 control-label control-label-content">${not empty oneBizAppInfo && oneBizAppInfo.hasMidPage == 'Y' ? '是' : '否'}</label>
                                                        </div>
                                                    </div>
                                                    <div class="form-group form-group-new">
                                                        <label class="col-sm-2 control-label">h5地址：</label>
                                                        <div class="col-sm-8">
                                                            <input type="text" id="appLinkUrl" name="appLinkUrl" class="form-control" maxlength="1000" value="${not empty oneBizAppInfo ? oneBizAppInfo.appLinkUrl : ''}">
                                                            <span class="help-block m-b-none tip"></span>
                                                        </div>
                                                    </div>
                                                </c:if>
                                                <c:if test="${not empty hasPackage && hasPackage == 1}">
                                                    <h5 class="page-header page-header-new"><i class="fa fa-file-text"></i>&nbsp;&nbsp;服务包
                                                        <button type="button" class="btn btn-primary right-btn" onclick="doDelPackage();">删除</button>
                                                        <button type="button" class="btn btn-primary right-btn" onclick="doAddPackageSelf();">新增自定义</button>
                                                        <button type="button" class="btn btn-primary right-btn" onclick="doAddPackage();">新增</button>
                                                    </h5>
                                                    <div class="_packageDiv">
                                                        <div id="_packageDiv">
                                                            <c:if test="${not empty packageList}">
                                                                <c:forEach items="${packageList}" var="item">
                                                                </c:forEach>
                                                            </c:if>
                                                        </div>
                                                    </div>
                                                </c:if>
                                            </c:otherwise>
                                        </c:choose>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="ibox float-e-margins">
            <div class="ibox-content">
                <div class="form-group" id="_btnDiv">
                    <div class="col-sm-4 col-sm-offset-5">
                        <c:if test="${editType!='info'}">
                            <input type="button" class="btn btn-primary" onclick="doOrgBizAppSave()" value="保存">
                        </c:if>
                        <input type="button" class="btn btn-white" onclick="doCheckDataChange()" value="返回">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${ctx}/js/app/win/editChildOrgBizAppMgr.js?t=${now}"></script>
</body>
</html>

